

#ifndef _GLOBAL_H__
#define _GLOBAL_H__

#define FALSE   0
#define TRUE    1
#undef  NULL
#define NULL    0

#ifndef INVALID_HANDLE_VALUE
//#define INVALID_HANDLE_VALUE (0)
#endif

#define MAX_PATH 260

#ifndef BOOL
typedef int BOOL;
#endif
typedef unsigned char uint8;
typedef unsigned long uint32;
typedef unsigned char   BYTE;
typedef unsigned char* LPBYTE;
typedef unsigned long		DWORD;
typedef unsigned short      WORD;
typedef unsigned int		UINT; 
typedef long LONG;

typedef void * HANDLE;

#define  CONVERT_SHORT(Src,Dst) {(Dst) = MAKEWORD(HIBYTE(Src),LOBYTE(Src));}


#define  CONVERT_INT(Src,Dst)   {\
	(Dst)  = MAKELONG(MAKEWORD(HIBYTE(HIWORD(Src)),LOBYTE(HIWORD(Src))),\
	MAKEWORD(HIBYTE(LOWORD(Src)),LOBYTE(LOWORD(Src))));\
                                }
#define MAKEWORD(a, b)      ((WORD)(((BYTE)(a)) | ((WORD)((BYTE)(b))) << 8))
#define MAKELONG(a, b)      ((LONG)(((WORD)(a)) | ((DWORD)((WORD)(b))) << 16))
#define LOWORD(l)           ((WORD)(l))
#define HIWORD(l)           ((WORD)(((DWORD)(l) >> 16) & 0xFFFF))
#define LOBYTE(w)           ((BYTE)(w))
#define HIBYTE(w)           ((BYTE)(((WORD)(w) >> 8) & 0xFF))
#endif // _GLOBAL_H__


